import { request } from '/@/utils/http/axios';
// 新增编辑教师
export const saveTeacher = (data) => {
  return request({
    url: '/pjls/addPjls',
    method: 'POST',
    data,
  });
};


// 教师列表
export const getTeacherCard = (params) => {
  return request({
    url: `/sysAuthAbout/getPyjsAccountList`,
    method: 'get',
    params,
  });
};

// 删除账号
export const deleteByIds = (params) => {
  return request({
    url: `/sysAuthAbout/deleteAccount`,
    method: 'POST',
    params,
  });
};

// 学院列表
export const getXyList = (params) => {
  return request({
    url: `/yzb/xyList`,
    method: 'get',
    params,
  });
};


// 设置状态
export const setStatus = (params) => {
  return request({
    url: `/sysAuthAbout/roleEnableOrDisable`,
    method: 'POST',
    params,
  });
};
// 管理账号管理
export const setPipeStatus = (params) => {
  return request({
    url: `/sysAuthAbout/accountEnableOrDisable`,
    method: 'POST',
    params,
  });
}
// 管理账号详情角色
export const getInfoJsinfo = (params) => {
  return request({
    url: `/sysAuthAbout/getRoleListByAccount`,
    method: 'GET',
    params,
  });
}

// 新增和编辑账号管理
export const addTeacher = (params) => {
  return request({
    url: `/sysAuthAbout/${params.createTime?'updateAccount':'saveAccount'}`,
    method: 'POST',
    params,
  });
}



// 修改账号密码

export const updatePwdTeacher = (params) => {
  return request({
    url: `/sysAuthAbout/updatePwd`,
    method: 'POST',
    params,
  });
}



// 删除
export const delFun = (params) => {
  return request({
    url: `/sysAuthAbout/deleteRoleInfo`,
    method: 'POST',
    params,
  });
};

// 详情
export const getRoleInfo = (params) => {
  return request({
    url: `/sysAuthAbout/findRolePermissionList`,
    method: 'GET',
    params,
  });
};



// 数据字典
export const dictionaryTeacher = (params) => {
  return request({
    url: `/sysAuthAbout/dictionaryList`,
    method: 'GET',
    params,
  });
};





// 权限管理账号列表
export const getAccountNumberList = (params) => {
  return request({
    url: `/sysAuthAbout/findRoleInfoList`,
    method: 'GET',
    params,
  });
};


// 分配角色
export const setDistributeRoleSync = (params) => {
  return request({
    url: `/sysAuthAbout/distributeRoleSync`,
    method: 'POST',
    params,
  });
};

// 角色修改编辑
export const allotSubject = (params) => {
  return request({
    url: `/sysAuthAbout/${params.roleId?'updateRoleInfo':'saveRoleInfo'}`,
    method: 'POST',
    params,
  });
};






/**
 * 获取异常类型列表
 * @param params 
 * @returns 
 */

export const getYcztConfigList = (params) => {
  return request({
    url: `/basic/getYcztConfigList`,
    method: 'GET',
    params,
  });
};

/**
 * 新增异常类型列表
 * @param params 
 * @returns 
 */

export const addYcztConfig = (params) => {
  return request({
    url: params.autoId?`/basic/updateYcztConfig`:`/basic/addYcztConfig`,
    method: 'POST',
    params,
  });
};

/**
 * 删除异常类型列表
 * @param params 
 * @returns 
 */

export const delYcztConfig = (params) => {
  return request({
    url: `/basic/delYcztConfig`,
    method: 'POST',
    params,
  });
};




/**
 * 切换系统年份
*/
export const setSysYear = (params) => {
  return request({
    url: `/basic/exchangeSysYear`,
    method: 'GET',
    params,
  });
};



// 获取/修改系统参数配置
export const getConfigInfo = (params) => {
  return request({
    url: `/basic/getFunctionSwitch`,
    method: 'GET',
    params,
  });
};

// 查询参数
export const setConfigInfo = (params) => {
  return request({
    url: `/basic/updateFunctionSwitch`,
    method: 'POST',
    params,
  });
};



// 教师列表
export const getManageTeacherCard = (params) => {
  return request({
    url: `/sysAuthAbout/getManageAccountList`,
    method: 'get',
    params,
  });
};